#!/usr/bin/perl -w

##HACKABOT_HELP##
# Who want's a Zima?
# !zima [#chan] nick
##HACKABOT_HELP##

use strict;
use Hackabot::Client;

my $hbc = Hackabot::Client->new;
my $msg = $hbc->readline;

if ($msg =~ /(#\S+)\s+(.+)/) {
    print "to $1\n";
    $msg = $2;
}

if (not $msg)
    my @names = $hbc->names($chan);
    $msg = $names[int(rand(@names))];
}

print "send Waah waah! $msg wants a Zima!\n";
